//
//  CellModel.h
//  PlanDemo
//
//  Created by 在成长开发 on 2025/9/8.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum : NSUInteger {
    CellType_Fixed              = 0,// 固定单元格
    CellType_Text               = 1,// 文本单元格
    CellType_Activity           = 2,// 活动单元格
} CellType;

static NSInteger const kActivityRowStep = 4;
static NSInteger const kActivityColStep = 2;

static NSInteger const kTextRowStep = 1;
static NSInteger const kTextColStep = 1;

@interface CellModel : NSObject

@property (nonatomic, assign) double row;
@property (nonatomic, assign) double useRow;
@property (nonatomic, assign) double col;
@property (nonatomic, assign) double useCol;

@property (nonatomic, assign) CellType type;
// 只有活动格可以拖动
- (BOOL)canDrag;
// 此次仅假设 只有活动格可以接受放下操作
- (BOOL)canDropFrom:(CellModel *)other;

@property(nonatomic, copy) NSString * content;

/// 第十五周计划用例，共 14行 12列
+ (NSMutableArray <CellModel *>*)fifteenWeek;

+ (NSMutableArray <CellModel *>*)thirteenWeek;

+ (NSMutableArray <CellModel *>*)emptyWeekPlan;

+ (void)createItemsSameAsLast:(NSMutableArray *)source startRow:(NSInteger)startRow appendRow:(NSInteger)appendRow;
+ (void)createItemsNoMerge:(NSMutableArray *)source startRow:(NSInteger)startRow appendRow:(NSInteger)appendRow;

+ (void)updateCells:(NSMutableArray <CellModel *>*)result noon:(CellModel *)noon afterRow:(NSInteger)startRow appendRow:(NSInteger)appendRow;

@end

NS_ASSUME_NONNULL_END
